class EventEmiter {
  constructor() {
    this.event = {}
  }

  emit (event, ...args) {
    if (this.event[event]) {
      this.event[event].forEach(fn => {
        fn.apply(this, args)
      });
    }
  }

  on (event, fn) {
    if (this.event[event]) {
      this.event[event].push(fn)
    } else {
      this.event[event] = [fn]
    }
  }
  remove (event) {
    delete this.event[event]
  }
}

const eHub = new EventEmiter()
eHub.on('ttq', (val) => { console.log(val); })

eHub.emit('ttq', 'wbd')
